<template>
		<view class="my-search-container" :style="{'background-color':bgColor}" @click="searchClickHandler">
		  <view class="my-search-box" :style="{'border-radius':radius+'px'}">
        <!-- 使用uni-ui提供的图标组件 -->
        <uni-icons type="search" size="17"></uni-icons>
        <text class="placeholder">搜索</text>
		  </view>
		</view>
</template>

<script>
	export default {
    props:{
      // 背景颜色
      bgColor:{
        type:String,
        default:'#c00000'
      },
      // 圆角
      radius:{
        type:Number,
        default:18
      }
    },
		data() {
			return {
				
			};
		},
    methods:{
      // 在封装组件的点击事件
      searchClickHandler(){
        this.$emit('myClick')
      }
    },
	}
</script>

<style lang="scss">
.my-search-container{
  // background-color: #c00000;
  height: 50px;
  padding: 0 10px;
  display: flex;
  align-items: center;
}
.my-search-box{
  background-color: #FFFFFF;
  height: 36px;
  // border-radius: 18px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  .placeholder{
    font-size: 12px;
    margin-left: 5px;
  }
}
</style>
